<template>
</template>
<script>
    import xurl from '../../x/xurl'

    export default {
        name: "shortUrl",
        created() {
            let keyword = this.$route.params.keyword
            let url = this.NW_API_vue + "/" + keyword
            xurl.getSync(url, {}, true).then(data => {
                if (data.success) {
                    window.location.replace(data.result.redirect)
                } else {
                    window.location.replace("/error?msg=" + data.errMsg)
                }
            })
        }
    }
</script>
